package com.example.fittrack.domain.entity;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@JsonIgnoreProperties(ignoreUnknown = true)
@EqualsAndHashCode()
@Data
@Entity
@Table(name = "magic_api_file", uniqueConstraints = @UniqueConstraint(columnNames = "file_path"))
public class MagicApiFilePo {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @JsonSerialize(using = ToStringSerializer.class)
    private Integer id;

    @NotNull
    @Column(name = "file_path", length = 512, nullable = false)
    private String filePath;

    @NotNull
    @Lob
    @Column(name = "file_content", nullable = false)
    private String fileContent;
}